package com.taoism.customEnum;

/**
 * Excel类型枚举
 *
 * @author 李嘉
 * @version 1.0
 * @Description Excel类型枚举
 * @date 2019-07-13 23:09
 */
public enum ExcelTypeEnum {

    /**
     * 导入
     */
    IMPORT("导入", 1),

    /**
     * 导出
     */
    EXPORT("导出", 2);

    private String name;
    private int index;

    ExcelTypeEnum() {
    }

    ExcelTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(int index) {
        for (ExcelTypeEnum info : ExcelTypeEnum.values()) {
            if (info.getIndex() == index) {
                return info.getName();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
